home *** CD-ROM | disk | FTP | other *** search
/ Corbis Images Sampler - Red / RED.iso / pc / Interface / inter.dxr / 00020_Yes-No Alert.ls < prev    next >
Encoding:
Text File  |  1999-12-21  |  1.5 KB  |  52 lines

  1. property message, icon, alerttittel, movableon, yeslingo, nolingo
  2.  
  3. on mouseUp me
  4.   puppetSound(2, "click")
  5.   myalertproplist = [#buttons: #YesNo, #message: message, #icon: icon, #title: alerttittel, #movable: movableon]
  6.   myalertbox = new(xtra("MUI"))
  7.   if objectp(myalertbox) then
  8.     result = alert(myalertbox, myalertproplist)
  9.     case result of
  10.       1:
  11.         do(yeslingo)
  12.       2:
  13.         do(nolingo)
  14.     end case
  15.   end if
  16. end
  17.  
  18. on getPropertyDescriptionList me
  19.   theprops = [:]
  20.   c = "Type your question"
  21.   f = #string
  22.   d = "Continue ?"
  23.   addProp(theprops, #message, [#comment: c, #format: f, #default: d])
  24.   c = "What kind of icon do you want?"
  25.   f = #symbol
  26.   r = [#stop, #note, #caution, #question]
  27.   d = getAt(r, 1)
  28.   typeprops = [#comment: c, #format: f, #range: r, #default: d]
  29.   addProp(theprops, #icon, typeprops)
  30.   c = "Window title?"
  31.   f = #string
  32.   d = "Alert"
  33.   addProp(theprops, #alerttittel, [#comment: c, #format: f, #default: d])
  34.   c = "Movable?"
  35.   f = #boolean
  36.   d = 0
  37.   addProp(theprops, #movableon, [#comment: c, #format: f, #default: d])
  38.   c = "Lingo for Yes"
  39.   f = #string
  40.   d = EMPTY
  41.   addProp(theprops, #yeslingo, [#comment: c, #format: f, #default: d])
  42.   c = "Lingo for No"
  43.   f = #string
  44.   d = EMPTY
  45.   addProp(theprops, #nolingo, [#comment: c, #format: f, #default: d])
  46.   return theprops
  47. end
  48.  
  49. on getBehaviorDescription
  50.   return "The 'YNAlert' creates a alert box with a 'Yes' and a 'No' button. You choose the title, the message, what kind of icon you want and the Lingo for Yes and No."
  51. end
  52.